<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8">
	<link type="text/css" href="/CommandsOnline/resources/css/jquery-ui.css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="/CommandsOnline/resources/css/flexigrid.css">
	<link type="text/css" href="resources/css/main.css" rel="stylesheet"/>
	<script type="text/javascript" src="/CommandsOnline/resources/jquery.min.js"></script>
	<script type="text/javascript" src="/CommandsOnline/resources/jquery-ui.min.js"></script>
	<script type="text/javascript" src="/CommandsOnline/resources/flexigrid.js"></script>
<script type="text/javascript">
function init() {
//JSON-Call server for main menu creation 
	$.getJSON('json/menu/a', function(data) {
		  var items = [];
		  var contents = [];
		  $.each(data, function(key, val) {
			  					if (key=="menuItems"){
			  						$.each(val, function(index,val) {
			  							items.push('<li><a href="#tabs-'+index+'">' + val + '</a></li>');		
			  						});
			  					}
			  					if (key=="menuContents"){
			  						$.each(val, function(index,val) {
			  							contents.push('<div id="tabs-'+index+'"></div>');		
			  						});
			  					}			  					
		  			});
		  $('<ul/>', 	{html:    items.join('')}).appendTo("#mainMenu");
		  $('<div/>', 	{html: contents.join('')}).appendTo("#mainMenu");
		  
		  $("#mainMenu").tabs();
		  $("#mainMenu").height($(document).height()-155);
		  
		  //Load Tab Content
			$("#mainMenu").tabs("url",0,"user/advertisingRegistryList");
			$("#mainMenu").tabs("url",1,"admin/usersList");
			$("#mainMenu").tabs("load",$("#mainMenu").tabs( "option", "selected" ));
		  
		});	
}

$(document).ready(init);
</script>	
<title><spring:message code="label.title" /></title>
</head>
<body title="User's Main Form">
	<div id="header">
	  <div class="center">
	    <div id="logo"><a href="#">STANDART</a></div>
	   </div>
	</div>
	<a href="<c:url value="/logout" />"> <spring:message code="label.logout" /> </a> 
	<button id="addTabButton" style="visibility:hidden;" > Add Tab </button>	<br>	
	
	
	
	<div id=mainMenu> </div>
	

</body>
</html>